#include <stdio.h>
#include <stdlib.h>
// #include"f.h"
// #include <time.h>
// #include <string.h>
int func(int begain,int max,int* p){
    if(begain == max){
        return max;
    }
    else{
        return begain+func(begain*10+*p,max,p);
    }

}

int main(int argc,const char* argv[])
{   
    int begain=0, max=0;
    int*p=&begain;
    printf("请输入起始数  最大位 (空格隔开)\n");
    scanf("%d %d",&begain,&max);
    printf("和为:%d\n",func(begain,max,p));
    return 0;
}